﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace oled
{
    public partial class OLED : Form
    {
        public OLED()
        {
            //this.Width = OLED_Width;
            //this.Height = OLED_Height;
            InitializeComponent();
        }
        //public OLED(int OLED_Height, int OLED_Width)
        //{
        //    //this.Width = OLED_Width;
        //    //this.Height = OLED_Height;
        //    InitializeComponent();
        //}
        private void Enter_Click(object sender, EventArgs e)
        {
            int OLED_Height, OLED_Width;
            bool height = int.TryParse(this.OLED_Height.Text, out OLED_Height);
            bool width = int.TryParse(this.OLED_Width.Text, out OLED_Width);
            bool visiable = this.Enter.Visible;


            if (!height || !width || OLED_Height < 32 || OLED_Width < 32)
            {
            }
            else
            {
                OLED_Height *= 5;
                OLED_Width *= 5;
                this.BackColor = System.Drawing.SystemColors.HotTrack;
                this.OLED_Height.Visible = !visiable;
                this.OLED_Width.Visible = !visiable;
                this.OLED_FPS.Visible = !visiable;
                this.label_Height.Visible = !visiable;
                this.label_Width.Visible = !visiable;
                this.label_FPS.Visible = !visiable;
                this.Enter.Visible = !visiable;
                this.Width = OLED_Width;
                this.Height = OLED_Height;
                this.Width = OLED_Width + 27;
                this.Height = OLED_Height + 50;

            }
        }

    }
}
